#include"Acceptor.hh"
#include"eventpool.hh"
#include<string>

class TcpServer
{
public:
    using Tcpconptr=shared_ptr<TcpConnection>;
    using func_call=function<void(const Tcpconptr&)>;
    explicit TcpServer(const string &ip,int port);
    ~TcpServer();
    void start();
    void stop();
    void setallcallback(func_call && close,
                        func_call&& conn,
                        func_call&& msg);
private:
Acceptor _acceptor;
Eventpool _pool;
};
